
import type { FilterRuleOptions, TypeConfig, RuleGenerationResult } from './types';
import { createBaseRule } from './ruleGeneratorUtils';

const miscConfig: TypeConfig = {
    class: 'Stackable Currency',
    icon: 'White',
    iconShape: 'Circle',
    name: '杂项',
    fontSize: 45
};

const goldConfig: TypeConfig = {
    class: 'Gold',
    name: '杂项 - 金币',
    fontSize: 36,
    icon: 'Yellow',
    iconShape: 'Star'
};

export function generateMiscRule(options: FilterRuleOptions): RuleGenerationResult {
    // 特殊处理金币
    if (options.value === 'Gold') {
        return createBaseRule(
            {
                ...options,
                color: '#EB5620', // 235 86 32
                bgColor: '#000000'
            },
            {
                name: goldConfig.name,
                class: goldConfig.class,
                defaultColor: '#EB5620',
                defaultBgColor: '#000000',
                fontSize: goldConfig.fontSize,
                icon: goldConfig.icon,
                iconShape: goldConfig.iconShape
            }
        );
    }

    // 其他杂项的处理
    return createBaseRule(options, {
        name: miscConfig.name,
        class: miscConfig.class,
        defaultColor: '#FFFFFF',
        defaultBgColor: '#000000',
        fontSize: miscConfig.fontSize,
        icon: miscConfig.icon,
        iconShape: miscConfig.iconShape
    });
}